﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奖品详情 - 模切材料小管家</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            /* TDesign 工业品色彩系统 */
            --primary-color: #0052d9;
            --primary-light: #266fe8;
            --primary-dark: #003cab;
            --secondary-color: #f2f3ff;
            --accent-color: #e37318;
            --success-color: #00a870;
            --warning-color: #ed7b2f;
            --error-color: #d54941;
            
            /* 背景色系 */
            --bg-color-page: #f5f7fa;
            --bg-color-container: #ffffff;
            --bg-color-secondray: #f8f9fc;
            
            /* 边框和分割线 */
            --border-color: #e7e7e7;
            --border-color-light: #f0f0f0;
            --border-radius-small: 3px;
            --border-radius-medium: 6px;
            --border-radius-large: 9px;
            
            /* 文字色彩 */
            --text-primary: #1a1a1a;
            --text-secondary: #4e5969;
            --text-placeholder: #86909c;
            --text-disabled: #c9cdd4;
            
            /* 阴影系统 */
            --shadow-1: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            --shadow-2: 0 1px 4px 0 rgba(0, 0, 0, 0.08);
            --shadow-3: 0 4px 8px 0 rgba(0, 0, 0, 0.12);
            
            /* 间距系统 */
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --space-8: 32px;
            --space-10: 40px;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }
        
        body {
            background-color: var(--bg-color-page);
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.5;
            padding-bottom: 120px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        
        .container {
            max-width: 480px;
            margin: 0 auto;
            background: var(--bg-color-container);
            min-height: 100vh;
            box-shadow: var(--shadow-1);
            position: relative;
            overflow-x: hidden;
        }
        
        /* 头部样式 - TDesign 简约风格 */
        .header {
            background: var(--primary-color);
            color: white;
            padding: var(--space-4) var(--space-4) var(--space-5);
            position: relative;
            z-index: 10;
        }
        
        .top-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-4);
        }
        
        .back-btn {
            font-size: 18px;
            cursor: pointer;
            opacity: 0.9;
            transition: opacity 0.2s ease;
        }
        
        .back-btn:hover {
            opacity: 1;
        }
        
        .page-title {
            font-weight: 500;
            font-size: 16px;
        }
        
        .actions {
            display: flex;
            gap: var(--space-5);
        }
        
        .actions i {
            font-size: 16px;
            cursor: pointer;
            opacity: 0.9;
            transition: opacity 0.2s ease;
        }
        
        .actions i:hover {
            opacity: 1;
        }
        
        /* 主要内容区域 */
        .main-content {
            padding: var(--space-4);
        }
        
        /* 奖品图片 */
        .prize-image {
            width: 100%;
            height: 200px;
            background: var(--bg-color-secondray);
            border-radius: var(--border-radius-medium);
            margin-bottom: var(--space-4);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-placeholder);
            font-size: 48px;
            position: relative;
        }
        
        .prize-badge {
            position: absolute;
            top: var(--space-2);
            right: var(--space-2);
            padding: var(--space-1) var(--space-2);
            border-radius: var(--border-radius-small);
            font-size: 11px;
            font-weight: 500;
        }
        
        .badge-hot {
            background: var(--error-color);
            color: white;
        }
        
        .badge-new {
            background: var(--success-color);
            color: white;
        }
        
        .badge-limited {
            background: var(--warning-color);
            color: white;
        }
        
        /* 奖品基本信息 */
        .prize-info {
            background: var(--bg-color-container);
            border-radius: var(--border-radius-medium);
            padding: var(--space-4);
            margin-bottom: var(--space-4);
            box-shadow: var(--shadow-1);
            border: 1px solid var(--border-color-light);
        }
        
        .prize-title {
            font-size: 20px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: var(--space-3);
            line-height: 1.3;
        }
        
        .prize-points {
            font-size: 24px;
            font-weight: 700;
            color: var(--accent-color);
            margin-bottom: var(--space-3);
        }
        
        .prize-meta {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            color: var(--text-secondary);
            font-size: 14px;
        }
        
        .meta-item i {
            color: var(--text-placeholder);
            width: 16px;
            text-align: center;
        }
        
        /* 详细信息卡片 */
        .info-card {
            background: var(--bg-color-container);
            border-radius: var(--border-radius-medium);
            margin-bottom: var(--space-4);
            box-shadow: var(--shadow-1);
            border: 1px solid var(--border-color-light);
            overflow: hidden;
        }
        
        .card-header {
            padding: var(--space-4);
            background: var(--bg-color-secondray);
            border-bottom: 1px solid var(--border-color-light);
        }
        
        .card-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
        }
        
        .card-title i {
            margin-right: var(--space-2);
            color: var(--success-color);
            font-size: 14px;
        }
        
        .card-content {
            padding: var(--space-4);
        }
        
        .prize-description {
            font-size: 14px;
            color: var(--text-primary);
            line-height: 1.6;
            margin-bottom: var(--space-3);
        }
        
        .exchange-rules {
            background: #fff7e6;
            border: 1px solid #ffd591;
            border-radius: var(--border-radius-medium);
            padding: var(--space-3);
            margin-top: var(--space-3);
        }
        
        .rules-title {
            font-size: 12px;
            font-weight: 600;
            color: #d46b08;
            margin-bottom: var(--space-2);
        }
        
        .rules-content {
            font-size: 12px;
            color: #d46b08;
            line-height: 1.5;
        }
        
        /* 底部操作区 */
        .bottom-actions {
            position: fixed;
            bottom: 64px;
            left: 0;
            right: 0;
            background: var(--bg-color-container);
            padding: var(--space-4);
            border-top: 1px solid var(--border-color-light);
            display: flex;
            gap: var(--space-2);
            z-index: 100;
            max-width: 480px;
            margin: 0 auto;
        }
        
        .btn {
            flex: 1;
            padding: var(--space-3);
            border: none;
            border-radius: var(--border-radius-medium);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .btn-secondary {
            background: var(--bg-color-secondray);
            color: var(--text-secondary);
            border: 1px solid var(--border-color-light);
        }
        
        .btn-secondary:hover {
            background: var(--border-color-light);
        }
        
        .btn-primary {
            background: var(--primary-color);
            color: white;
        }
        
        .btn-primary:hover {
            background: var(--primary-dark);
        }
        
        .btn:disabled {
            background: var(--text-disabled);
            color: white;
            cursor: not-allowed;
        }
        
        /* 底部导航栏 - TDesign 简约风格 */
        .tabbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--bg-color-container);
            border-top: 1px solid var(--border-color);
            display: flex;
            z-index: 100;
            max-width: 480px;
            margin: 0 auto;
            height: 64px;
        }
        
        .tab-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: var(--space-2) 0;
            cursor: pointer;
            transition: color 0.2s ease;
            color: var(--text-placeholder);
        }
        
        .tab-item.active {
            color: var(--primary-color);
        }
        
        .tab-item:hover {
            color: var(--primary-light);
        }
        
        .tab-item i {
            font-size: 18px;
            margin-bottom: var(--space-1);
        }
        
        .tab-item span {
            font-size: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 头部区域 -->
        <div class="header">
            <div class="top-bar">
                <div class="back-btn" onclick="history.back()">
                    <i class="fas fa-arrow-left"></i>
                </div>
                <div class="page-title">奖品详情</div>
                <div class="actions">
                    <i class="fas fa-share-alt" onclick="sharePrize()"></i>
                    <i class="fas fa-heart" onclick="toggleFavorite()"></i>
                </div>
            </div>
        </div>
        
        <!-- 主要内容区域 -->
        <div class="main-content">
            <!-- 奖品图片 -->
            <div class="prize-image">
                <i class="fas fa-mobile-alt" id="prizeIcon"></i>
                <div class="prize-badge badge-hot" id="prizeBadge">热门</div>
            </div>
            
            <!-- 奖品基本信息 -->
            <div class="prize-info">
                <div class="prize-title" id="prizeTitle">iPhone 15 Pro</div>
                <div class="prize-points" id="prizePoints">5,000 积分</div>
                <div class="prize-meta">
                    <div class="meta-item">
                        <i class="fas fa-tag"></i>
                        <span id="prizeCategory">数码产品</span>
                    </div>
                    <div class="meta-item">
                        <i class="fas fa-box"></i>
                        <span id="prizeStock">库存 5 件</span>
                    </div>
                </div>
            </div>
            
            <!-- 奖品描述 -->
            <div class="info-card">
                <div class="card-header">
                    <div class="card-title">
                        <i class="fas fa-file-text"></i>
                        奖品描述
                    </div>
                </div>
                <div class="card-content">
                    <div class="prize-description" id="prizeDescription">
                        最新款iPhone 15 Pro，128GB存储，支持5G网络，配备A17 Pro芯片，性能强劲。采用钛金属设计，更加坚固耐用。配备三摄系统，支持专业级摄影功能。
                    </div>
                </div>
            </div>
            
            <!-- 兑换规则 -->
            <div class="info-card">
                <div class="card-header">
                    <div class="card-title">
                        <i class="fas fa-gift"></i>
                        兑换规则
                    </div>
                </div>
                <div class="card-content">
                    <div class="exchange-rules">
                        <div class="rules-title">兑换须知</div>
                        <div class="rules-content">
                            1. 兑换后不可退换，请确认信息无误后再兑换<br>
                            2. 奖品将在7个工作日内发货，请保持联系方式畅通<br>
                            3. 收货地址仅限中国大陆地区<br>
                            4. 如遇缺货，将提供等值积分补偿<br>
                            5. 最终解释权归平台所有
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部操作区 -->
        <div class="bottom-actions">
            <button class="btn btn-primary" onclick="exchangePrize()" id="exchangeBtn">
                <i class="fas fa-gift"></i>
                立即兑换
            </button>
        </div>
        
        <!-- 底部导航 -->
        <div class="tabbar">
            <div class="tab-item" onclick="location.href='home.html'">
                <i class="fas fa-home"></i>
                <span>首页</span>
            </div>
            <div class="tab-item" onclick="location.href='demand-list.html'">
                <i class="fas fa-search"></i>
                <span>求购</span>
            </div>
            <div class="tab-item" onclick="location.href='publish-select.html'">
                <i class="fas fa-plus-circle"></i>
                <span>发布</span>
            </div>
            <div class="tab-item" onclick="location.href='consultation.html'">
                <i class="fas fa-comments"></i>
                <span>客服</span>
            </div>
            <div class="tab-item" onclick="location.href='profile.html'">
                <i class="fas fa-user"></i>
                <span>我的</span>
            </div>
        </div>
    </div>
    
    <script>
        // 模拟奖品数据
        const prizeData = {
            1: {
                title: 'iPhone 15 Pro',
                description: '最新款iPhone 15 Pro，128GB存储，支持5G网络，配备A17 Pro芯片，性能强劲。采用钛金属设计，更加坚固耐用。配备三摄系统，支持专业级摄影功能。',
                points: 5000,
                category: '数码产品',
                stock: 5,
                badge: 'hot',
                image: 'fas fa-mobile-alt'
            },
            2: {
                title: 'MacBook Air M2',
                description: '13英寸MacBook Air，搭载M2芯片，8GB内存，256GB存储，轻薄便携。适合办公、学习、娱乐等多种场景使用。',
                points: 8000,
                category: '数码产品',
                stock: 3,
                badge: 'new',
                image: 'fas fa-laptop'
            }
        };
        
        let currentPoints = 1280;
        
        // 加载奖品数据
        function loadPrizeData() {
            const urlParams = new URLSearchParams(window.location.search);
            const prizeId = urlParams.get('id');
            
            if (prizeId && prizeData[prizeId]) {
                const prize = prizeData[prizeId];
                
                // 更新页面内容
                document.getElementById('prizeTitle').textContent = prize.title;
                document.getElementById('prizeDescription').textContent = prize.description;
                document.getElementById('prizePoints').textContent = `${prize.points.toLocaleString()} 积分`;
                document.getElementById('prizeCategory').textContent = prize.category;
                document.getElementById('prizeStock').textContent = `库存 ${prize.stock} 件`;
                document.getElementById('prizeIcon').className = prize.image;
                
                // 更新徽章
                if (prize.badge) {
                    const badgeElement = document.getElementById('prizeBadge');
                    badgeElement.textContent = getBadgeText(prize.badge);
                    badgeElement.className = `prize-badge badge-${prize.badge}`;
                } else {
                    document.getElementById('prizeBadge').style.display = 'none';
                }
                
                // 更新兑换按钮
                const exchangeBtn = document.getElementById('exchangeBtn');
                if (currentPoints >= prize.points) {
                    exchangeBtn.innerHTML = '<i class="fas fa-gift"></i> 立即兑换';
                    exchangeBtn.disabled = false;
                } else {
                    exchangeBtn.innerHTML = '<i class="fas fa-gift"></i> 积分不足';
                    exchangeBtn.disabled = true;
                }
            }
        }
        
        // 获取徽章文本
        function getBadgeText(badge) {
            const badgeMap = {
                'hot': '热门',
                'new': '新品',
                'limited': '限量'
            };
            return badgeMap[badge] || badge;
        }
        
        // 分享奖品
        function sharePrize() {
            if (navigator.share) {
                navigator.share({
                    title: document.getElementById('prizeTitle').textContent,
                    text: document.getElementById('prizeDescription').textContent,
                    url: window.location.href
                });
            } else {
                navigator.clipboard.writeText(window.location.href).then(() => {
                    alert('奖品链接已复制到剪贴板');
                });
            }
        }
        
        // 切换收藏
        function toggleFavorite() {
            const heartIcon = document.querySelector('.fa-heart');
            if (heartIcon.classList.contains('fas')) {
                heartIcon.classList.remove('fas');
                heartIcon.classList.add('far');
                heartIcon.style.color = '';
            } else {
                heartIcon.classList.remove('far');
                heartIcon.classList.add('fas');
                heartIcon.style.color = 'var(--error-color)';
            }
        }
        
        
        // 兑换奖品
        function exchangePrize() {
            const exchangeBtn = document.getElementById('exchangeBtn');
            if (exchangeBtn.disabled) {
                return;
            }
            
            const prizeTitle = document.getElementById('prizeTitle').textContent;
            const prizePoints = document.getElementById('prizePoints').textContent;
            
            if (confirm(`确定要用${prizePoints}兑换${prizeTitle}吗？`)) {
                alert('兑换成功！奖品将在7个工作日内发货');
            }
        }
        
        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            loadPrizeData();
        });
        
        // 底部导航切换
        document.querySelectorAll('.tab-item').forEach(item => {
            item.addEventListener('click', function() {
                document.querySelectorAll('.tab-item').forEach(t => t.classList.remove('active'));
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>